package com.auction.mapper;

import com.auction.dto.SellerApplicationPageQueryDTO;
import com.auction.pojo.SellerApplication;
import com.auction.vo.SellerApplicationVO;
import com.auction.vo.SellerInfoVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SellerApplicationMapper {

    /**
     * 根据ID查询申请
     *
     * @param id
     * @return
     */
    @Select("SELECT * FROM seller_application WHERE id = #{id}")
    SellerApplication selectById(@Param("id") Long id);

    /**
     * 根据用户ID查询申请
     * 
     * @param userId
     * @return
     */
    @Select("SELECT * FROM seller_application WHERE user_id = #{userId}")
    SellerApplication selectByUserId(@Param("userId") Long userId);

    /**
     * 插入卖家申请
     *
     * @param sellerApplication
     */
    void insert(SellerApplication sellerApplication);


    /**
     * 更新申请状态
     * 
     * @param sellerApplication
     */
    void update(SellerApplication sellerApplication);

    /**
     * 查询申请列表
     * 
     * @param status
     * @return
     */
    List<SellerApplication> selectByStatus(@Param("status") Integer status);

    /**
     * 分页查询申请列表
     * @param pageQueryDTO
     * @return
     */
    Page<SellerApplicationVO> pageQuery(SellerApplicationPageQueryDTO pageQueryDTO);
}